package com.qianfeng.smartdevice.mapper;

import com.qianfeng.smartdevice.pojo.SysCategory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @time: 2022-03-17 15:12
 */
public interface SysCategoryMapper {

    @Insert("INSERT INTO sys_category (category_name,tx_command,rx_command,command_name,create_by,create_time)" +
            "values (#{categoryName},#{txCommand},#{rxCommand},#{commandName},#{createBy},#{createTime})")
    void addSysCategory(SysCategory sysCategory);

    @Select("SELECT * FROM sys_category WHERE c_id=#{id}")
    SysCategory findById(Long id);

    @Select("SELECT * FROM sys_category")
    List<SysCategory> findAll();

    int updateCategory(SysCategory syscategory);

    int deleteByIds(@Param("ids") List<Long> ids);

}
